package spring.cloud.tasks.client.item_task_processor;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TaskProcessorHeartBeatTimerTask extends java.util.TimerTask {
    private TaskProcessor taskProcessor;

    public TaskProcessorHeartBeatTimerTask(TaskProcessor taskProcessor) {
        this.taskProcessor = taskProcessor;
    }

    public void run() {
        try {
            Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
            if (taskProcessor.needPongPong) {
                taskProcessor.pongpong();//心脏跳动
            } else {
                //
            }
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
}
